package com.example.app.util

/**
 *
 */
class CalculatePrice {

    fun calculate(size: Int, bSize: Int): Int {
        when (bSize) {
            10 ->
                when (size) {
                    10 -> return 5000000
                    9 -> return 8000
                    8 -> return 800
                    7 -> return 80
                    6 -> return 5
                    5 -> return 3
                    0 -> return 2
                }
            9 ->
                when (size) {
                    9 -> return 300000
                    8 -> return 2000
                    7 -> return 200
                    6 -> return 20
                    5 -> return 5
                    4 -> return 3
                    0 -> return 2
                }
            8 ->
                when (size) {
                    2 -> 1
                }
            7 ->
                when (size) {
                    2 -> 1
                }
            6 ->
                when (size) {
                    2 -> 1
                }
            5 ->
                when (size) {
                    5 -> return 1000
                    4 -> return 21
                    3 -> return 3
                }
            4 ->
                when (size) {
                    4 -> 100
                    3 -> 5
                    2 -> 3
                }
            3 ->
                when (size) {
                    3 -> 53
                    2 -> 3
                }


        }
        return 0
    }

    /**
     * 复试计算
     */
    fun calculateFs(size: Int, bSize: Double): Int {
        when (bSize) {
            0.9 ->
                when (size) {
                    10 -> return 3000000
                    9 -> return 318000
                    8 -> return 5600
                    7 -> return 740
                    6 -> return 110
                    5 -> return 40
                    4 -> return 18
                    1 -> return 2
                    0 -> return 20
                }

        }
        return 0
    }

}